/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package MiniProjet.modeles;

import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Query;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author SaLaH
 */
@Entity
public class LigneCommande implements Serializable {
     private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;
    @OneToOne(cascade={CascadeType.ALL}, fetch=FetchType.EAGER)
    private Film film;
    private double total;
    private int quantite;

    public LigneCommande() {
        
    }

    public LigneCommande(Film film, double total, int quantite) {
        this.film = film;
        this.total = total;
        this.quantite = quantite;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Film getFilm() {
        return film;
    }

    public double getTotal() {
        return total;
    }

    public int getQuantite() {
        return quantite;
    }

    public void setFilm(Film film) {
        this.film = film;
    }

    public void setQuantite(int quantite) {
        this.quantite = quantite;
    }

    public void setTotal(double total) {
        this.total = total;
    }

    @Override
    public String toString() {
        return "MiniProjet.modeles.ligneCommande[id=" + id + "]";
    }

}
